<template>
  <div class="broadcast">
    <c-title :hide="false" :text="'购买记录'"></c-title>
    <div class="broadcast_record">
      <div class="lis" v-for="(item, index) in list" :key="index">
        <img :src="item.avatar_image" alt="" />
        <span class="txt">{{ item.content }}</span>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      list: []
    };
  },
  activated() {
    this.getData();
  },
  methods: {
    async getData() {
      let { data, msg, result } = await $http.post("plugin.broadcast.frontend.controllers.broadcast.get-buy-log-list", {id: this.$route.query.goods_id}, "");
      if (result) {
        this.list = data;
      } else {
        this.$toast(msg);
      }
    }
  }
};
</script>
<style lang="scss" scoped>
.broadcast {
  overflow: hidden;
}
.broadcast_record {
  background: #ffffff;
  border-radius: 0.5rem;
  margin: 0.63rem 0.72rem;
  padding: 0.94rem 0.75rem;
  box-sizing: border-box;
  .lis {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    img {
      width: 2rem;
      height: 2rem;
      border-radius: 50%;
      background: #d6d6dc;
      margin: 0;
      margin-right: 0.5rem;
    }
    .txt {
      font-weight: 400;
      font-size: 0.88rem;
      color: #6e6e79;
      line-height: 1;
    }
  }
  .lis:last-child {
    margin-bottom: 0;
  }
}
</style>
